import { ApiCall } from "tsrpc";
import { ReqClearAllMails, ResClearAllMails } from "../../../shared/protocols/masterServer/mail/PtlClearAllMails";
import { MasterServerConn } from "../../MasterServer";
import { DBMail } from "../../DBMail";

export async function ApiClearAllMails(call: ApiCall<ReqClearAllMails, ResClearAllMails>) {
    let req = call.req;
    let info = (call.conn as MasterServerConn).userInfo;
    DBMail.clearMailsByUid(info.uid!);
    call.succ({});
}